<!DOCTYPE html>
<html>
<head>
<php>
$this_parent = sp_get_term($cat_id);
$second=sp_get_term($this_parent[parent]);
</php>
	<title>{$name}┊{$second['name']}┊{$site_name}</title>
    <meta http-equiv="Content-Language" content="ru_RU">
	<meta name="keywords" content="{$seo_keywords}" />
	<meta name="description" content="{$seo_description}">
    <tc_include file="Public:head" />
</head>
<body>
<tc_include file="Public:nav" />
<div class="container tc-main">
	
	
    <div class="pg-opt pin">
        <div class="col-md-12">
                    <div style=" float:right;">
                        <ol style="margin-top: 34px;">
                            <a href="__ROOT__/" style="color: #59b2e5;">Главная</a> ┊
                            <a  href="{:u('list/index',array('id'=>$second['term_id']))}" style="color: #59b2e5;">{$second['name']}</a> ┊
                            {$name}
                        </ol>
                     </div>
                        <h2>{$name}</h2>
                    <h5 style="margin-left:50px;white-space: nowrap;">
                         
                            <php>
                                $first = sp_get_terms($cat_id);
                                for($i = 0;$i < sizeof($first);$i++)
                                {
                                    if($this_parent[parent] == $first[$i][parent])
                                    {
                                    </php>
                                         <a href="{:u('list/index',array('id'=>$first[$i][term_id]))}" style="color: #59b2e5;">{$first[$i][name]}</a>┊
                                    <php>
                                    }
                                }
                        </php>
                    </h5>
                </div>
    </div>
    <div class="row">
		<div class="span9">
			<div class="">
				<php>
					$lists = sp_sql_posts_paged("cid:$cat_id;order:post_date DESC;",10);
				</php>
				<volist name="lists['posts']" id="vo">
				<php>
					$smeta=json_decode($vo['smeta'], true);
				</php>
				
				<div class="list-boxes">
					<h2><a href="{:leuu('article/index',array('id'=>$vo['tid']))}">{$vo.post_title}</a></h2>
					<p>{$vo.post_excerpt}</p>
					<div>
						<div class="pull-left">
							<div class="list-actions">
							<a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
							<a href="{:U('article/do_like',array('id'=>$vo['object_id']))}" class="J_count_btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
							<a href="{:U('user/favorite/do_favorite',array('id'=>$vo['object_id']))}" class="J_favorite_btn" data-title="{$vo.post_title}" data-url="{:U('portal/article/index',array('id'=>$vo['tid']))}" data-key="{:sp_get_favorite_key('posts',$vo['object_id'])}">
								<i class="fa fa-star-o"></i>
							</a>
							</div>
						</div>
						<a class="btn btn-warning pull-right" href="{:leuu('article/index',array('id'=>$vo['tid']))}">Смотреть более</a>
					</div>
				</div>
				</volist>
				
			</div>
			<div class="pagination">
				<ul>
					{$lists['page']}
				</ul>
			</div>
		</div>
		<div class="span3">
			<div class="tc-box first-box">
			<div class="headtitle">
          		<h2>Поделиться</h2>
          	</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-54acf10b5c282aae" async="async"></script>
<style type="text/css">
.at-share-tbx-element .at-share-btn {
margin: 0 3px 0 0;
}
</style>
<div class="addthis_sharing_toolbox"></div>
        	</div>
        	
        	<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>Популярные статьи</h2>
	        	</div>
	        	<div class="ranking">
	        		<php>
						$hot_articles=sp_sql_posts("field:post_title,post_excerpt,tid,smeta;order:post_hits desc;limit:6;"); 
					</php>
		        	<ul class="unstyled">
		        		<foreach name="hot_articles" item="vo">
		        			<php>$top=$key<3?"top3":"";</php>
							<li class="{$top}"><i>{$key+1}</i><a title="{$vo.post_title}" href="{:leuu('article/index',array('id'=>$vo['tid']))}">{$vo.post_title}</a></li>
						</foreach>
					</ul>
				</div>
			</div>
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>Последние каменты</h2>
	        	</div>
	        	<div class="comment-ranking">
	        		<php>$last_comments=sp_get_comments("field:*;limit:0,5;order:createtime desc;");</php>
	        		<foreach name="last_comments" item="vo">
	                    <div class="comment-ranking-inner">
	                        <i class="fa fa-comment"></i>
	                        <a href="{:U('user/index/index',array('id'=>$vo['uid']))}">{$vo.full_name}:</a>
	                        <span>{$vo.content}</span>
	                        <a href="__ROOT__/{$vo.url}#comment{$vo.id}">Посмотреть оригинал</a>
	                        <span class="comment-time">{:date('d - m  H:i',strtotime($vo['createtime']))}</span>
	                    </div>
                    </foreach>
                </div>
			</div>
			
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>Новые пользователи</h2>
	        	</div>
	        	<php>
	        	$last_users=sp_get_users("field:*;limit:0,8;order:create_time desc;");
	        	</php>
	        	<ul class="list-unstyled tc-photos margin-bottom-30">
	        		<foreach name="last_users" item="vo">
                    <li>
	                    <a href="{:U('user/index/index',array('id'=>$vo['id']))}">
	                    <img alt="" src="{:U('user/public/avatar',array('id'=>$vo['id']))}">
	                    </a>
                    </li>
                    </foreach>
                </ul>
			</div>
			
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>последний выпуск</h2>
	        	</div>
	        	<php>
					$last_post=sp_sql_posts("field:post_title,post_excerpt,tid,smeta;order:listorder asc;limit:6;"); 
				</php>
	        	<div class="posts">
	        		<foreach name="last_post" item="vo">
	        		<php>$smeta=json_decode($vo['smeta'],true);</php>
			        	<dl class="dl-horizontal">
				            <dt>
					            <a class="img-wraper" href="{:U('article/index',array('id'=>$vo['tid']))}">
					            	<if condition="empty($smeta['thumb'])"> 
										<img src="__TMPL__Public/images/default_tupian4.png" class="img-responsive" alt="{$vo.post_title}"/>
									<else /> 
										<img src="{:sp_get_asset_upload_path($smeta['thumb'])}" class="img-responsive img-thumbnail" alt="{$vo.post_title}" />
									</if>
					            </a>
				            </dt>
				            <dd><a href="{:leuu('article/index',array('id'=>$vo['tid']))}">{:msubstr($vo['post_excerpt'],0,32)}</a></dd>
				        </dl>
			        </foreach>
		        </div>
			</div>
            <div class="tc-box">
	        	<div class="posts">
	        		<a href="http://info.flagcounter.com/s31P" target="_blank">
                    <img src="http://s11.flagcounter.com/count/s31P/bg_FFFFFF/txt_428BCA/border_FFFFFF/columns_3/maxflags_15/viewers_3/labels_1/pageviews_1/flags_2/" alt="Flag Counter" border="0">
                    </a>
		        </div>
			</div>
		</div>
    </div>
    
    
    <tc_include file="Public:footer" />
</div>

    
<!-- JavaScript -->
<tc_include file="Public:scripts" />
</body>
</html>